from django.urls import path

from . import views

app_name = "project"

urlpatterns = [
    path("", views.ProjectListView.as_view(), name="index"),
    path("", views.ProjectListView.as_view(), name="list"),
    path("create", views.ProjectCreateView.as_view(), name="create"),

    path("<int:pk>", views.ProjectDetailView.as_view(), name="detail",),
    path("<int:pk>/update", views.ProjectUpdateView.as_view(), name="update",),
    path("<int:pk>/audit", views.ProjecAuditFormPostAPIView.as_view(), name="audit",),

    # Plan =====================================================================
    path("<int:project_pk>/plan/", views.PlanListView.as_view(), name="plan/list",),
    path("<int:project_pk>/plan/create", views.PlanCreateView.as_view(), name="plan/create",),
    path("<int:project_pk>/plan/<int:pk>", views.PlanDetailView.as_view(), name="plan/detail",),
    path("<int:project_pk>/plan/<int:pk>/update", views.PlanUpdateView.as_view(), name="plan/update",),
    path("<int:project_pk>/plan/<int:pk>/audit", views.PlanAuditFormPostAPIView.as_view(), name="plan/audit",),
    
    # Initiation ===============================================================
    path("<int:project_pk>/initiation/", views.InitiationListView.as_view(), name="initiation/list",),
    path("<int:project_pk>/initiation/create", views.InitiationCreateView.as_view(), name="initiation/create",),
    path("<int:project_pk>/initiation/<int:pk>", views.InitiationDetailView.as_view(), name="initiation/detail",),
    path("<int:project_pk>/initiation/<int:pk>/update", views.InitiationUpdateView.as_view(), name="initiation/update",),
    path("<int:project_pk>/initiation/<int:pk>/audit", views.InitiationAuditFormPostAPIView.as_view(), name="initiation/audit",),

    # Ethical Review ===========================================================
    path("<int:project_pk>/ethical_review/", views.EthicalReviewListView.as_view(), name="ethical_review",),
    path("<int:project_pk>/ethical_review/create", views.EthicalReviewCreateView.as_view(), name="ethical_review/create",),
    path("<int:project_pk>/ethical_review/<int:pk>", views.EthicalReviewDetailView.as_view(), name="ethical_review/detail",),
    path("<int:project_pk>/ethical_review/<int:pk>/update", views.EthicalReviewUpdateView.as_view(), name="ethical_review/update",),
    
    # Human Genetic Resources ===================================================
    path("<int:project_pk>/human_genetic_resource/", views.HumanGeneticResourceIndexView.as_view(), name="human_genetic_resource",),
    path("<int:project_pk>/human_genetic_resource/create", views.HumanGeneticResourceCreateView.as_view(), name="human_genetic_resource/create",),
    path("<int:project_pk>/human_genetic_resource/detail", views.HumanGeneticResourceDetailView.as_view(), name="human_genetic_resource/detail",),
    path("<int:project_pk>/human_genetic_resource/update", views.HumanGeneticResourceUpdateView.as_view(), name="human_genetic_resource/update",),
    path('<int:project_pk>/human_genetic_resource/add-form/<str:form_type>/', views.HGRHTMXAddFormView.as_view(), name='human_genetic_resource/add_form'),
    
    # Contract =================================================================
    path("<int:project_pk>/contract/", views.ContractListView.as_view(), name="contract/list",),
    path("<int:project_pk>/contract/create", views.ContractCreateView.as_view(), name="contract/create",),
    path("<int:project_pk>/contract/<int:pk>", views.ContractDetailView.as_view(), name="contract/detail",),
    path("<int:project_pk>/contract/<int:pk>/update", views.ContractUpdateView.as_view(), name="contract/update",),

    # Before Implement ===========================================================
    path("<int:project_pk>/before_implement/", views.BeforeImplementIndexView.as_view(), name="before_implement",),
    path("<int:project_pk>/before_implement/detail", views.BeforeImplementDetailView.as_view(), name="before_implement/detail",),
    path("<int:project_pk>/before_implement/create", views.BeforeImplementCreateView.as_view(), name="before_implement/create",),
    path("<int:project_pk>/before_implement/update", views.BeforeImplementUpdateView.as_view(), name="before_implement/update",),
    path("<int:project_pk>/before_implement/audit", views.BeforeImplementAuditFormPostAPIView.as_view(), name="before_implement/audit",),

    # Material =================================================================
    path("<int:project_pk>/material/", views.MaterialListView.as_view(), name="material/list",),
    path("<int:project_pk>/material/create", views.MaterialCreateView.as_view(), name="material/create",),
    path("<int:project_pk>/material/<int:pk>", views.MaterialDetailView.as_view(), name="material/detail",),
    path("<int:project_pk>/material/<int:pk>/update", views.MaterialUpdateView.as_view(), name="material/update",),

    # Beginning ================================================================
    path("<int:project_pk>/beginning/", views.BeginningIndexView.as_view(), name="beginning",),
    path("<int:project_pk>/beginning/detail", views.BeginningDetailView.as_view(), name="beginning/detail",),
    path("<int:project_pk>/beginning/create", views.BeginningCreateView.as_view(), name="beginning/create",),
    path("<int:project_pk>/beginning/update", views.BeginningUpdateView.as_view(), name="beginning/update",),

    # Implement ================================================================
    path("<int:project_pk>/implement/", views.ImplementIndexView.as_view(), name="implement",),
    path("<int:project_pk>/implement/detail", views.ImplementDetailView.as_view(), name="implement/detail",),
    path("<int:project_pk>/implement/create", views.ImplementCreateView.as_view(), name="implement/create",),
    path("<int:project_pk>/implement/update", views.ImplementUpdateView.as_view(), name="implement/update",),
    path("<int:project_pk>/implement/audit", views.ImplementAuditFormPostAPIView.as_view(), name="implement/audit",),

    # Quality Control ==========================================================
    path("<int:project_pk>/quality_control/", views.QualityControlListView.as_view(), name="quality_control/list",),
    path("<int:project_pk>/quality_control/create", views.QualityControlCreateView.as_view(), name="quality_control/create",),
    path("<int:project_pk>/quality_control/<int:pk>", views.QualityControlDetailView.as_view(), name="quality_control/detail",),
    path("<int:project_pk>/quality_control/<int:pk>/update", views.QualityControlUpdateView.as_view(), name="quality_control/update",),

    # Finish ===================================================================
    path("<int:project_pk>/finish/", views.FinishIndexView.as_view(), name="finish",),
    path("<int:project_pk>/finish/detail", views.FinishDetailView.as_view(), name="finish/detail",),
    path("<int:project_pk>/finish/create", views.FinishCreateView.as_view(), name="finish/create",),
    path("<int:project_pk>/finish/update", views.FinishUpdateView.as_view(), name="finish/update",),
    path("<int:project_pk>/finish/audit", views.FinishAuditFormPostAPIView.as_view(), name="finish/audit",),
    
    # Examination ===============================================================
    path("<int:project_pk>/examination/", views.ExaminationListView.as_view(), name="examination/list",),
    path("<int:project_pk>/examination/create", views.ExaminationCreateView.as_view(), name="examination/create",),
    path("<int:project_pk>/examination/<int:pk>", views.ExaminationDetailView.as_view(), name="examination/detail",),
    path("<int:project_pk>/examination/<int:pk>/update", views.ExaminationUpdateView.as_view(), name="examination/update",),


    ## Management ==============================================================
    path("management/list", views.ProjectManagementView.as_view(), name="management/list")
]
